﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using ReceiptPrint.Models;


namespace ReceiptPrint.ViewModels.ReceiptInfoVMs
{
    public partial class ReceiptInfoTemplateVM : BaseTemplateVM
    {
        [Display(Name = "商品名称")]
        public ExcelPropety Name_Excel = ExcelPropety.CreateProperty<ReceiptInfo>(x => x.Name);
        [Display(Name = "单价")]
        public ExcelPropety Price_Excel = ExcelPropety.CreateProperty<ReceiptInfo>(x => x.Price);
        [Display(Name = "数量")]
        public ExcelPropety Number_Excel = ExcelPropety.CreateProperty<ReceiptInfo>(x => x.Number);
        [Display(Name = "税率")]
        public ExcelPropety Tax_Excel = ExcelPropety.CreateProperty<ReceiptInfo>(x => x.Tax);
        public ExcelPropety Template_Excel = ExcelPropety.CreateProperty<ReceiptInfo>(x => x.TemplateId);

	    protected override void InitVM()
        {
            Template_Excel.DataType = ColumnDataType.ComboBox;
            Template_Excel.ListItems = DC.Set<Template>().GetSelectListItems(Wtm, y => y.Name);
        }

    }

    public class ReceiptInfoImportVM : BaseImportVM<ReceiptInfoTemplateVM, ReceiptInfo>
    {

    }

}
